<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html lang="en">
<head>
	<title>未处理的变更</title>
	<%@include file="/common/commonCSS.jsp" %>
	<%@include file="/common/commonJS.jsp" %>
	<%@include file="/WEB-INF/jsp/include/taglib.jsp" %>


	</head>
<body>
<div class="main-container" id="main-container">

	<div class="row" style="margin-top: 20px;">
		<div class="row" style="margin-top: 20px;">
			<div class="col-md-12">
				<form class="layui-form" id="search-from" action="${webRoot}/report/chgreport/ChgLineOrginMonth">
					<div class="layui-form-item">
						<label class="layui-form-label" style="width:6%;">名称:</label>
						<div class="layui-input-inline">
							<input type="text" name="name" value="${params.name}"  placeholder="请输入名称"  class="layui-input" >
						</div>
						<button class="layui-btn" id="searchSubmit"><i class="layui-icon">&#xe615;</i>搜 索</button>
						<button class="layui-btn layui-btn-warm" type="button" id="refresh">重 置</button>
						<%--<a class="layui-btn" href="${webRoot}/sla/slaalerttemp/info"><i class="layui-icon">&#xe61f;</i> 新 增</a>--%>
					</div>
				</form>
			</div>
		</div>
	</div>
	<div id="container" style="min-width:400px;height:400px"></div>
</div>
<script type="text/javascript">


    var result = ${data};
    var month = new Array();
//    var extParams = jQuery.extend(true,{},params);
    var header = result[0];
    var series = new Array();
    for(var i=0;i<header.length;i++){
        var s = {};
        var opts  = new Array();
        s.name = header[i].name;
        var count = new Array();
        $.each(result[1][i],function(j,item){
            month[j] = item.MONTH ;
            count[j] = parseInt(item.COUNT);
            var tmpParam = {};
            tmpParam.sqlId = "IncGridQuery";
            tmpParam.inc_create_date_month = item.MONTH ;
            tmpParam[tmpParam.queryCondition] = header[i].dictValue;
            delete tmpParam.beginDate;
            delete tmpParam.endDate;
            opts[j] = tmpParam;
        });
        s.data = count;
        s.opts = opts;
        series[i] = s;
    }

    var clickFunction = function(e){
        var series = e.point.series;
        var tmpParam = series.options.opts[e.point.index];
        top.window.getListIncident(tmpParam);
    };

    $('#container').highcharts({
        title: {
            text: '按月统计变更工单各来源数量折线图',
            x: -20
        },
        credits: {enabled:false},
        xAxis: {categories: month},
        yAxis: {
            title: { text: '数量' } ,
            plotLines: [{
                value: 0,
                width: 1,
                color: '#808080'
            }]
        },
        lang : {noData : '暂无数据显示'},
        plotOptions: {
            line: {
                allowPointSelect: true,
                cursor: 'pointer',
                dataLabels: {
                    enabled: true,
                    formatter: function() {
                        return Highcharts.numberFormat(this.y, 0, ',');
                    }
                },
                events:{
                    click:clickFunction
                }
            }
        },
        series: series
    });





</script>
</body>

</html>